<?php
namespace Ccc\Gal\Controller;
use Doctrine\ORM\Mapping as ORM;

/*                                                                        *
 * This script belongs to the FLOW3 package "Ccc.Gal".                    *
 *                                                                        *
 *                                                                        */

use TYPO3\FLOW3\Annotations as FLOW3;

/**
 * image controller for the Ccc.Gal package 
 *
 * @FLOW3\Scope("singleton")
 */
class ImageController extends \TYPO3\FLOW3\Mvc\Controller\ActionController {

	/**
	 * @FLOW3\Inject
	 * @var \Ccc\Gal\Domain\Repository\ImageRepository
	 */
	protected $imageRepository;
	
	/**
	 * Index action
	 *
	 * @return void
	 */
	public function indexAction() {
		$this->view->assign('gallery', '00ad00e9-4644-4680-b91b-876a6d08c1ad');
	}
	
	/**
	 * New action
	 *
	 * @return void
	 */
	public function newAction() {
		$this->view->assign('gallery', '00ad00e9-4644-4680-b91b-876a6d08c1ad');
	}
	
	/**
	 * Show action
	 *
	 * @return void
	 */
	public function showAction() {

	}
	
	/**
	 * Create action
	 * @param \Ccc\Gal\Domain\Model\Image $newImage
	 * @return void
	 */
	public function createAction(\Ccc\Gal\Domain\Model\Image $newImage) {
		//$this->imageRepository->add($newImage);	
		print_r($_POST);
	}
	
	/**
	 * Ajaxnew action
	 *
	 * @return void
	 */
	public function ajaxnewAction() {
		$this->view->assign('gallery', '00ad00e9-4644-4680-b91b-876a6d08c1ad');
	}
	
	/**
	 * Ajaxcreate action
	 * @param \Ccc\Gal\Domain\Model\Image $newImage
	 * @return void
	 */
	public function ajaxcreateAction(\Ccc\Gal\Domain\Model\Image $newImage) {
		$this->imageRepository->add($newImage);	

		$this->view->assign('printr',print_r($_POST ));
		//var $printrstring = print_r($_POST);
		//return $printrstring;
	}

}

?>